clear;clc;
A=[2.1,3.4,-1.2,2.3;0.8,-0.3,4.1,2.8;2.3,7.9,-1.5,1.4;3.5,7.2,1.7,-9.0];
x=[1;2;3;4];
% [P,D]=eig(A)
% syms n
% syms x_n
% P*D^n*P^-1
% x_n=ans*x_0
%limit(x_n,n,inf)  %验证得到极限不存在
y=x;m=0;
tx=[];tm=[];ty=[];
for i=1:50
    x=A*y;
    tx(i,1:4)=x;
    m=(abs(max(x))>=abs(min(x)))*max(x)+(abs(max(x))<abs(min(x)))*min(x);
    tm(i,1)=m;
    y=x/m;
    ty(i,1:4)=y;
end
tx
ty
tm